package com.wyd.resourcetj.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.CreationTimestamp;
import org.springframework.format.annotation.DateTimeFormat;

import lombok.Data;

/**
 * Member
 */
@Data
@Entity
@Table

public class Member {

    @Id
    @GeneratedValue
    
    private Integer id;
    @Column(unique = true)
    private String card_no;
    private String name;
    private String sex;
    private String category;
    @Column(length = 18,unique = true)
    private String card;//身份证号，唯一，确保一个用户只有一个会员卡
    
    private String phone;
    private String swpartment;
    private String profession;
    private String grade;
    @CreationTimestamp//自动生成系统时间，格式为yyyy-MM-dd hh:MM:ss
    private Date regdate;
    @Column(insertable = false,columnDefinition = "int default 0")
    private Integer status;//状态，0表示没有使用资源，默认为0
    private String remark;
   



    @ManyToOne(targetEntity = Read_Room.class)
	@JoinColumn(name = "rid")
	//@JsonIgnore
	private Read_Room read_Room;

}